﻿using System;
using FreeSql.DataAnnotations;

namespace Colorful.Furniture.IEntity;

/// <summary>
///  添加时间
/// </summary>
public interface IAddTime
{
    /// <summary>
    ///  添加时间
    /// </summary>

    DateTime AddTime { get; set; }
}

/// <summary>
///  添加用户
/// </summary>
/// <typeparam name="TAddUserPrimaryKey"></typeparam>
public interface IAddUser<TAddUserPrimaryKey>
{
    /// <summary>
    ///  添加人
    /// </summary>

    TAddUserPrimaryKey AddUserId { get; set; }
}

/// <summary>
///   添加用户
/// </summary>
public interface IAddUserGuid : IAddUser<Guid?> { }


/// <summary>
///  添加聚合根
/// </summary>
public interface IAddAggregateRoot<TAddUserPrimaryKey> : IAddUser<TAddUserPrimaryKey>, IAddTime
{

}

/// <summary>
///  添加聚合根
/// </summary>
public interface IAddGuidAggregateRoot : IAddAggregateRoot<Guid?>
{

}

/// <summary>
///  添加聚合根
/// </summary>
public class AddGuidAggregateRoot : IAddGuidAggregateRoot
{
    /// <summary>
    ///  添加人
    /// </summary>
    [Column(Name = "add_user_id", CanUpdate = false, Position = -90)]
    public Guid? AddUserId { get; set; }

    /// <summary>
    ///  添加时间
    /// </summary>
    [Column(Name = "add_time", CanUpdate = false, Position = -89)]
    public DateTime AddTime { get; set; }
}

/// <summary>
///  添加聚合根
/// </summary>
public class AddTenantGuidAggregateRoot : AddGuidAggregateRoot, ITenantGuid
{
    /// <summary>
    ///  租户id
    /// </summary>
    [Column(Name = "tenant_id", Position = -83)]
    public Guid? TenantId { get; set; }
}

/// <summary>
///  添加软删除聚合根
/// </summary>
public class AddSoftDeleteGuidAggregateRoot : ISoftDelete
{
    /// <summary>
    ///  是否删除：0=未删除，1=已删除
    /// </summary>
    [Column(Name = "is_deleted", Position = -85)]
    public bool IsDeleted { get; set; }

    /// <summary>
    ///  删除时间
    /// </summary>
    [Column(Name = "deleted_time", Position = -84)]
    public DateTime? DeletedTime { get; set; }
}

/// <summary>
///  添加租户软删除聚合根
/// </summary>
public class AddTenantSoftDeleteGuidAggregateRoot : AddTenantGuidAggregateRoot, ISoftDelete
{
    /// <summary>
    ///  是否删除：0=未删除，1=已删除
    /// </summary>
    [Column(Name = "is_deleted", Position = -85)]
    public bool IsDeleted { get; set; }

    /// <summary>
    ///  删除时间
    /// </summary>
    [Column(Name = "deleted_time", Position = -84)]
    public DateTime? DeletedTime { get; set; }
}